package com.qinggeng.project.tool.third.domain;

import com.qinggeng.framework.aspectj.lang.annotation.Excel;
import com.qinggeng.framework.web.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 第三方登录对象 sys_third
 *
 * @author qinggeng
 * @date 2020-03-13
 */
@Data
public class SysThird extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long thirdId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 第三方应用 */
    @Excel(name = "第三方应用")
    private String platform;

    /** 第三方唯一ID */
    @Excel(name = "第三方唯一ID")
    private String openId;

    @Excel(name = "第三方多平台唯一ID")
    private String unionId;

    @Excel(name = "第三方多平台唯一ID")
    private String code;

    /** 第三方会员昵称 */
    @Excel(name = "第三方会员昵称")
    private String openName;

    /** AccessToken */
    @Excel(name = "AccessToken")
    private String accessToken;

    /** RefreshToken */
    @Excel(name = "RefreshToken")
    private String refreshToken;

    /** 有效期 */
    @Excel(name = "有效期")
    private String expiresIn;

    /** 登录时间 */
    @Excel(name = "登录时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date loginTime;

    /** 过期时间 */
    @Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;


    //会话密钥
    private String sessionKey;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("thirdId", getThirdId())
            .append("userId", getUserId())
            .append("platform", getPlatform())
            .append("openId", getOpenId())
            .append("openName", getOpenName())
            .append("accessToken", getAccessToken())
            .append("refreshToken", getRefreshToken())
            .append("expiresIn", getExpiresIn())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("loginTime", getLoginTime())
            .append("expireTime", getExpireTime())
            .toString();
    }
}
